
package TransportesMarroquin;

import com.mysql.jdbc.Connection;

import com.mysql.jdbc.ResultSetMetaData;
import com.mysql.jdbc.Statement;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class CabezalSelect extends javax.swing.JFrame {

    int num;
    Limitador limcd = new Limitador(11);
    Limitador limmar = new Limitador(50);
    Limitador limdoe = new Limitador(7);
    Limitador limtree = new Limitador(11);
    Limitador limun = new Limitador(11);
    public CabezalSelect(int cod) {

       initComponents();
     acep.setVisible(false);
     cd.setEnabled(false);
     cmar.setEnabled(false);
     doe.setEnabled(false);
     ckil.setEnabled(false);
     un.setEnabled(false);
     bcan.setVisible(false);
        num=cod;
        cd.setText(""+num);
        this.cod.setText(""+cod);

         cd.setDocument(limcd);
        cmar.setDocument(limmar);
        doe.setDocument(limdoe);
        ckil.setDocument(limtree);
        un.setDocument(limun);


        try {

                // coneccion a la base de datos
        MysqlDataSource datasource= new MysqlDataSource();
        datasource.setUser("root");
        datasource.setPassword("");
        datasource.setDatabaseName("practicasp8");
        datasource.setServerName("localhost");

          Connection conexion = (Connection) datasource.getConnection();


        Statement s = (Statement) conexion.createStatement();

 // query database
 ResultSet resultSet = s.executeQuery( "SELECT * FROM cabezal where idcabezal="+num);
        ResultSetMetaData metaData = (ResultSetMetaData) resultSet.getMetaData();
         int numerodecolumnas = metaData.getColumnCount();


       while (resultSet.next()){
        for(int i=1;i<=numerodecolumnas;i++){
             switch(i){
                 // creo este switch par delimitar el nombre de los label ya establecidos :D
                 case 1:
                     cd.setText(""+resultSet.getObject(i));
                   break;
                 case 2:
                     un.setText(""+resultSet.getObject(i));
                   break;
                 case 3:
                     doe.setText(""+resultSet.getObject(i));
                   break;
                 case 4:
                     ckil.setText(""+resultSet.getObject(i));
                   break;
                 case 5:
                     cmar.setText(""+resultSet.getObject(i));
                   break;  
                 default:
                     ;
                     break;
             }

         } // fin del for
       } // fin del while

        } catch (SQLException ex) {
            Logger.getLogger(ClienteSelect.class.getName()).log(Level.SEVERE, null, ex);
        } // fin del try and catch
    }

    /** Creates new form CabezalSelect */
    public CabezalSelect(){
       // initComponents();
        throw new UnsupportedOperationException("Not yet implemented");
       

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cd = new javax.swing.JTextField();
        ckil = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        doe = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        un = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        breg = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        cmar = new javax.swing.JTextField();
        Llantas = new javax.swing.JButton();
        bgas = new javax.swing.JButton();
        bvia = new javax.swing.JButton();
        bconf = new javax.swing.JButton();
        acep = new javax.swing.JButton();
        bcan = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        cod = new javax.swing.JLabel();
        n = new javax.swing.JLabel();
        lnum2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        cd.setEnabled(false);
        cd.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                cdKeyTyped(evt);
            }
        });

        ckil.setEnabled(false);
        ckil.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                ckilKeyTyped(evt);
            }
        });

        jLabel5.setText("C o d i g o ");

        doe.setEnabled(false);

        jLabel10.setText("Kilometraje");

        un.setEnabled(false);
        un.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                unActionPerformed(evt);
            }
        });
        un.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                unKeyTyped(evt);
            }
        });

        jLabel11.setText("Placa");

        jLabel12.setText("Codigo Piloto");

        breg.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/regresar.png"))); // NOI18N
        breg.setText("Regresar");
        breg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bregActionPerformed(evt);
            }
        });

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Cabezal2.gif"))); // NOI18N

        jLabel13.setText("Marca");

        cmar.setEnabled(false);
        cmar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                cmarKeyTyped(evt);
            }
        });

        Llantas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/illanta.png"))); // NOI18N
        Llantas.setText("Llantas");
        Llantas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LlantasActionPerformed(evt);
            }
        });

        bgas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/gastos.png"))); // NOI18N
        bgas.setText("Gastos");
        bgas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bgasActionPerformed(evt);
            }
        });

        bvia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/iviaje.png"))); // NOI18N
        bvia.setText("Viajes ");
        bvia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bviaActionPerformed(evt);
            }
        });

        bconf.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/config.png"))); // NOI18N
        bconf.setText("Configurar");
        bconf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bconfActionPerformed(evt);
            }
        });

        acep.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/aceptar.png"))); // NOI18N
        acep.setText("Aceptar");
        acep.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acepActionPerformed(evt);
            }
        });

        bcan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/cancelar.png"))); // NOI18N
        bcan.setText("Cancelar");
        bcan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bcanActionPerformed(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(143, 0, 0));

        cod.setFont(new java.awt.Font("Tahoma", 1, 18));
        cod.setForeground(new java.awt.Color(255, 255, 255));
        cod.setText("####");

        n.setFont(new java.awt.Font("Tahoma", 1, 18));
        n.setForeground(new java.awt.Color(255, 255, 255));
        n.setText("No.");

        lnum2.setFont(new java.awt.Font("Tahoma", 1, 18));
        lnum2.setForeground(new java.awt.Color(255, 255, 255));
        lnum2.setText("Cabezales");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lnum2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 85, Short.MAX_VALUE)
                .addComponent(n)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cod, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lnum2)
                    .addComponent(cod, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(n))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel5)
                .addGap(19, 19, 19)
                .addComponent(cd, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel12)
                .addGap(18, 18, 18)
                .addComponent(un, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel11)
                .addGap(55, 55, 55)
                .addComponent(doe, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel10)
                .addGap(27, 27, 27)
                .addComponent(ckil, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel13)
                .addGap(51, 51, 51)
                .addComponent(cmar, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel1)
                .addGap(13, 13, 13)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bgas, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bvia, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Llantas, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bconf, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(breg, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(acep, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addComponent(bcan, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(cd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel12))
                    .addComponent(un, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel11))
                    .addComponent(doe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(7, 7, 7)
                        .addComponent(jLabel10))
                    .addComponent(ckil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel13))
                    .addComponent(cmar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bgas)
                        .addGap(5, 5, 5)
                        .addComponent(bvia)
                        .addGap(5, 5, 5)
                        .addComponent(Llantas)
                        .addGap(5, 5, 5)
                        .addComponent(bconf)))
                .addGap(5, 5, 5)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(breg)
                    .addComponent(acep)
                    .addComponent(bcan)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bregActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bregActionPerformed
        dispose();
        Cabezal va;
      
            va = new Cabezal();
            va.setVisible(true);
            va.setBounds(114, 107, Toolkit.getDefaultToolkit().getScreenSize().width-114, Toolkit.getDefaultToolkit().getScreenSize().height-107);   
       
}//GEN-LAST:event_bregActionPerformed

    private void unActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_unActionPerformed

    private void LlantasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LlantasActionPerformed
        
        
        
        dispose();
        Llantas vap = new Llantas("select * from llanta where tipo_vehiculo like 'Cabezal' AND codigo_vehiculo ="+num+ " AND cementerio like 'no'","Cabezal No.",num);
        vap.setVisible(true);
        
        vap.setBounds(114, 107, Toolkit.getDefaultToolkit().getScreenSize().width-114, Toolkit.getDefaultToolkit().getScreenSize().height-107);
       
        
        
    }//GEN-LAST:event_LlantasActionPerformed

    private void bgasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bgasActionPerformed
  dispose();
   
  int kil = Integer.parseInt(ckil.getText());
        Gasto vap = new Gasto("select * from gasto where tipovehiculo like 'Cabezal' AND idvehiculo ="+num,num,"Cabezal",kil);
        vap.setVisible(true);
    
        vap.setBounds(114, 107, Toolkit.getDefaultToolkit().getScreenSize().width-114, Toolkit.getDefaultToolkit().getScreenSize().height-107);
    }//GEN-LAST:event_bgasActionPerformed

    private void bviaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bviaActionPerformed
        dispose();
        
        
        Viaje vap = new Viaje("select * from viaje where tipo_vehiculo like 'Cabezal' AND codigo_vehiculo ="+num,"Cabezal No.",num);
        vap.setVisible(true);
        
        vap.setBounds(114, 107, Toolkit.getDefaultToolkit().getScreenSize().width-114, Toolkit.getDefaultToolkit().getScreenSize().height-107);

}//GEN-LAST:event_bviaActionPerformed

    private void bconfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bconfActionPerformed

      // VOY A HABILITAR LOS CAMPOS DE TEXTO
        cd.setEnabled(true);
        cmar.setEnabled(true);
        doe.setEnabled(true);
        ckil.setEnabled(true);
        un.setEnabled(true);
        
     //Habilito los botones
        acep.setVisible(true);   // muestro aceptar.
        bcan.setVisible(true);
        breg.setVisible(false);
        bconf.setVisible(false);
        bgas.setVisible(false);
        bvia.setVisible(false);
        Llantas.setVisible(false);
     

    }//GEN-LAST:event_bconfActionPerformed

    private void acepActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acepActionPerformed
        //  opcion
        //UPDATE


        try {
            // coneccion
            //CONFIGURAR
            MysqlDataSource dataSource = new MysqlDataSource();
            dataSource.setUser("root");
            dataSource.setPassword("");
            dataSource.setDatabaseName("practicasp8");
            dataSource.setServerName("localhost");
            Connection conexion = (Connection) dataSource.getConnection();
            Statement instruccion = null;
            instruccion=(Statement) conexion.createStatement();
            // cambio los valores
            instruccion.executeUpdate("update cabezal set idcabezal='"+cd.getText()+"' where idcabezal="+num);
           instruccion.executeUpdate("update cabezal set marca='"+cmar.getText()+"' where idcabezal="+num);
            instruccion.executeUpdate("update cabezal set placa='"+doe.getText()+"' where idcabezal="+num);
            instruccion.executeUpdate("update cabezal set kilometraje='"+ckil.getText()+"' where idcabezal="+num);
            instruccion.executeUpdate("update cabezal set idpiloto='"+un.getText()+"' where idcabezal="+num);


            JOptionPane.showMessageDialog(rootPane, "Dato cambiado exitosamente" );

            acep.setVisible(false);
            bcan.setVisible(false);
            bconf.setVisible(true);
            breg.setVisible(true);
           bgas.setVisible(true);
           bvia.setVisible(true);
           Llantas.setVisible(true);
           cd.setEnabled(false);
           cmar.setEnabled(false);
           doe.setEnabled(false);
           ckil.setEnabled(false);
           un.setEnabled(false);



        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(rootPane, "Se ha producido un error al tratar de cambiar el dato. " );
        }

    }//GEN-LAST:event_acepActionPerformed

    private void bcanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bcanActionPerformed
        breg.setVisible(true);  // muestro el regresar
        acep.setVisible(false);
        bcan.setVisible(false);
        bgas.setVisible(true);
        bvia.setVisible(true);
        bconf.setVisible(true);
        Llantas.setVisible(true);

        // REGRESO A OCULTAR LOS DATOS
        cd.setEnabled(false);
        cmar.setEnabled(false);
        doe.setEnabled(false);
        ckil.setEnabled(false);
        un.setEnabled(false);


    }//GEN-LAST:event_bcanActionPerformed

    private void cdKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cdKeyTyped
              char c = evt.getKeyChar();
       if(!(Character.isDigit(c))|| c== evt.VK_BACK_SPACE || c==evt.VK_DELETE){
           getToolkit().beep();
           evt.consume();
       }
    }//GEN-LAST:event_cdKeyTyped

    private void unKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_unKeyTyped
             char c = evt.getKeyChar();
       if(!(Character.isDigit(c))|| c== evt.VK_BACK_SPACE || c==evt.VK_DELETE){
           getToolkit().beep();
           evt.consume();
       }
    }//GEN-LAST:event_unKeyTyped

    private void ckilKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_ckilKeyTyped
              char c = evt.getKeyChar();
       if(!(Character.isDigit(c))|| c== evt.VK_BACK_SPACE || c==evt.VK_DELETE){
           getToolkit().beep();
           evt.consume();
       }
    }//GEN-LAST:event_ckilKeyTyped

    private void cmarKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cmarKeyTyped
          char c = evt.getKeyChar();
      if (!(Character.isLetter(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE) || ((c== KeyEvent.VK_SPACE)))) {
            getToolkit().beep();
            evt.consume();
}
    }//GEN-LAST:event_cmarKeyTyped

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                
                    new CabezalSelect().setVisible(true);
               
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Llantas;
    private javax.swing.JButton acep;
    private javax.swing.JButton bcan;
    private javax.swing.JButton bconf;
    private javax.swing.JButton bgas;
    private javax.swing.JButton breg;
    private javax.swing.JButton bvia;
    private javax.swing.JTextField cd;
    private javax.swing.JTextField ckil;
    private javax.swing.JTextField cmar;
    private javax.swing.JLabel cod;
    private javax.swing.JTextField doe;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel lnum2;
    private javax.swing.JLabel n;
    private javax.swing.JTextField un;
    // End of variables declaration//GEN-END:variables

}
